package com.shixi.shixitraining.shixitraining.ui.tabhome.adapter;

import android.annotation.SuppressLint;
import android.content.Context;
import android.view.View;
import android.widget.TextView;

import com.shixi.shixitraining.shixitraining.R;
import com.shixi.shixitraining.shixitraining.ui.tabhome.entity.AuthenBean;
import com.shixi.shixitraining.shixitraining.view.recycleview.BaseAdapter;
import com.shixi.shixitraining.shixitraining.view.recycleview.BaseRecycleHolder;

import java.util.List;

/**
 * Created by shenyan on 2018/9/21.
 */
public class AuthenProjectAdapter extends BaseAdapter<AuthenBean.DataBean.SeriesBean> {


    private  boolean isSelect;
    private  int firstPosition=0;
    private TextView mTrainTv;


    public AuthenProjectAdapter(Context context, List<AuthenBean.DataBean.SeriesBean> data) {
        super(context, data);
    }

    @SuppressLint("ResourceAsColor")
    @Override
    public void convert(BaseRecycleHolder holder, AuthenBean.DataBean.SeriesBean item, int position) {
        mTrainTv = holder.getView(R.id.train_name);
        holder.setText(R.id.train_name,item.getName());


        int itemViewType = getItemViewType(position);

        mTrainTv.setOnClickListener(new View.OnClickListener() {
            @SuppressLint("ResourceAsColor")
            @Override
            public void onClick(View v) {
                mTrainTv.setBackgroundColor(R.color.basepresscolor);
                mTrainTv.setTextColor(R.color.white);
            }
        });

    }

    @Override
    protected int getLayoutId(int viewType) {
        return R.layout.adapter_train_project;
    }

    class Listener implements View.OnClickListener{
        private  AuthenBean.DataBean.SeriesBean  seriesBean;
        private  int mPosition;

        public Listener(AuthenBean.DataBean.SeriesBean seriesBean, int mPosition) {
            this.seriesBean = seriesBean;
            this.mPosition = mPosition;

        }

        @Override
        public void onClick(View v) {
            switch (v.getId()){
                case R.id.train_name:
                    break;
            }


        }
    }
}
